package com.mp.tool;

import org.apache.ibatis.reflection.MetaObject;

import com.baomidou.mybatisplus.mapper.MetaObjectHandler;

//公共字段填充处理器类
public class MyMetaObjectHandler extends MetaObjectHandler{
	@Override
	public void insertFill(MetaObject metaObject) {
		Object fieldValByName = getFieldValByName("name", metaObject);
		if (fieldValByName == null) {
			setFieldValByName("name", "唐艺昕", metaObject);
		}
	}
	@Override
	public void updateFill(MetaObject metaObject) {
		Object fieldValByName = getFieldValByName("name", metaObject);
		if (fieldValByName == null) {
			setFieldValByName("name", "亦菲", metaObject);
		}
	}
}
